<!DOCTYPE html>
<html>
<head>
	<title>全局变量在后面</title>
</head>
<body>
	<button onclick="variable()">点我触发函数</button>
	<button onclick="queryVar()">点我查看变量</button>
	<button onclick="selectVar()">点我查看变量</button>
</body>
	<script type="text/javascript">
		function variable(){
			json = "你好啊";
			console.log(json);
		}

		function queryVar(){
			console.log(json);
		}

		function selectVar(){
			console.log(json);
		}

		var json = "";
	</script>
</html>